-
-
Notifications
You must be signed in to change notification settings - Fork 197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[#4478] New notes model and admin controller #7212
Conversation
This adds admin route helpers for `PublicBody` and `InfoRequest` so we can call: 1. `admin_public_body_path(...)` -> `/admin/bodies/123` 2. `admin_info_request_path(...)` -> `/admin/requests/123` 3. `url_for([:admin, public_body_or_info_request])` and the correct route returned. This will be helpful for redirecting after creating/updating notes for a given record.
Instead of needing a `HasTagString::HasTagStringTag` instance this commit changes the helper to also accept a text string. Will correctly link and style the string tag with name/value to the tag admin controller. As this doesn't include the `model_type` so the tag controller will assume `PublicBody` which is fine and a good assumption to make.
This is the start of #4478
Adds an association as `Notable#concrete_notes` to avoid clashing with the current `PublicBody#notes` column. This uses a polymorphic association so any model can be `Notable`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good in principle; admin ui seems to break so can't test fully
@@ -485,6 +485,22 @@ | |||
end | |||
#### | |||
|
|||
#### AdminNote controller |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
be nicer to have shallow routes for new so that we can do e.g. /admin/bodies/3/notes/new
(which automatically sets notable_type
& notable_id
), but then editing the created note is simply /admin/note/:id/edit
. not essential this minute though
Allow notes to be created with an association to tags via a `Note#notable_tag` column. This updates `Notable#all_notes` to combine concrete and tagged notes. Fixes #6994
Relevant issue(s)
Fixes #4478
Fixes #6994
What does this do?
Adds new notes model and admin controller. Associated as a "concrete note" with
PublicBody
via a newNotable
concern. Also can be assoicated as a "tagged note" via anotable_tag
column.Why was this needed?
Easier handling of notes, especially via tags, so notes don't need to be manually added to multiple authorities.
Implementation notes
Have extract out these new issues from #4478
PublicBody#notes
toNote
model #7216PublicBody
import #7217PublicBody
Xapian indexing for notes #7218These will be done as separate PRs.
Screenshots
Notes to reviewer